import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.linear_model import Ridge
from sklearn.datasets import load_boston
from sklearn.metrics import r2_score

x, y = load_boston(return_X_y=True)

model = Ridge()
model.fit(x, y)
print(f'Score: {model.score(x, y)}')
h = model.predict(x)
e = r2_score(y, h)
print(f'R方精度: {e}')

